Some large system may have many ioapics which
have more than 256 pins totally. To support this
case, just let pirq == irq and build 1:1 mapping
between them, and this is based on the assumpation
that pirq == GSI number in dom0 for iopaic IRQs.
Thank Jan Beulich from Novell for reporting the issue
in pv_ops dom0.
Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
desc = irq_to_desc(irq);
cfg = desc->chip_data;
- /* Since PHYSDEVOP_alloc_irq_vector is dummy, rte.vector is the pirq
- which corresponds to this ioapic pin, retrieve it for building
- pirq and irq mapping.
+ /*
+ * Since PHYSDEVOP_alloc_irq_vector is dummy, rte.vector is the pirq
+ * which corresponds to this ioapic pin, retrieve it for building
+ * pirq and irq mapping. Where the GSI is greater than 256, we assume
+ * that dom0 pirq == irq.
*/
- pirq = rte.vector;
- if(pirq < 0 || pirq >= dom0->nr_pirqs)
+ pirq = (irq >= 256) ? irq : rte.vector;
+ if ( (pirq < 0) || (pirq >= dom0->nr_pirqs) )
return -EINVAL;
if ( desc->action )